package com.eagle.coders.security.transaction.beans;

import java.io.Serializable;
import java.math.BigDecimal;
//import java.sql.Date;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.eagle.coders.security.beans.UsersBean;


@Entity
//@NamedQueries( {
//    @NamedQuery(name = "UserLimit.findUserLimitsByUserId", 
//            query = "select object(o) from UserLimit o where o.userId=:userId") })
@Table(name="SY98SEC_USR_LMT")
@IdClass(UserLimitPK.class)
public class UserLimit  implements Serializable {
//	extends BaseDomainObject

	private static final long serialVersionUID = 1L;
    
	private Integer userId;
    
    private String moduleCode;
    
    private String currencyCode;
    
    private BigDecimal cashDebit;
    
    private BigDecimal cashCredit;
    
    private BigDecimal chequeDebit;
    
    private BigDecimal chequeCredit;
    
    private BigDecimal transferDebit;
    
    private BigDecimal transferCredit;
    
    private BigDecimal journalDebit;
    
    private BigDecimal journalCredit;
    
    private Date festDateBegin;
    
    private Date festDateEnd;
    
    private BigDecimal varAmount;
    
    private SecurityUser securityUser;
    
    private UsersBean user;
    
    @Id
    @Column(name="FCCD", nullable = false)
    public String getCurrencyCode() {
        return currencyCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }
    
    @Id
    @Column(name="MOD_CD", nullable = false, insertable = false, updatable = false)
    public String getModuleCode() {
        return moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }
    
    @Id
    @Column(name="USR_ID", nullable = false, insertable = false, updatable = false)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Column(name="CSH_CR")
    public BigDecimal getCashCredit() {
        return cashCredit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setCashCredit(BigDecimal cashCredit) {
        this.cashCredit = cashCredit;
    }
    
    @Column(name="CSH_DR")
    public BigDecimal getCashDebit() {
        return cashDebit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setCashDebit(BigDecimal cashDebit) {
        this.cashDebit = cashDebit;
    }
    
    @Column(name="CHQ_CR")
    public BigDecimal getChequeCredit() {
        return chequeCredit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setChequeCredit(BigDecimal chequeCredit) {
        this.chequeCredit = chequeCredit;
    }
    
    @Column(name="CHQ_DR")
    public BigDecimal getChequeDebit() {
        return chequeDebit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setChequeDebit(BigDecimal chequeDebit) {
        this.chequeDebit = chequeDebit;
    }
    
    @Column(name="JNL_CR")
    public BigDecimal getJournalCredit() {
        return journalCredit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setJournalCredit(BigDecimal journalCredit) {
        this.journalCredit = journalCredit;
    }
    
    @Column(name="JNL_DR")
    public BigDecimal getJournalDebit() {
        return journalDebit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setJournalDebit(BigDecimal journalDebit) {
        this.journalDebit = journalDebit;
    }
    
    @Column(name="TRF_CR")
    public BigDecimal getTransferCredit() {
        return transferCredit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setTransferCredit(BigDecimal tradeFinanceCredit) {
        this.transferCredit = tradeFinanceCredit;
    }
    
    @Column(name="TRF_DR")
    public BigDecimal getTransferDebit() {
        return transferDebit;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setTransferDebit(BigDecimal tradeFinanceDebit) {
        this.transferDebit = tradeFinanceDebit;
    }
    
    @Column(name="FEST_BEG_DT")
    public Date getFestDateBegin() {
        return festDateBegin;
    }

    public void setFestDateBegin(Date festDateBegin) {
        this.festDateBegin = festDateBegin;
    }
    
    @Column(name="FEST_END_DT")
    public Date getFestDateEnd() {
        return festDateEnd;
    }

    public void setFestDateEnd(Date festDateEnd) {
        this.festDateEnd = festDateEnd;
    }
    
    @Column(name="FEST_LMT_VAR")
    public BigDecimal getVarAmount() {
        return varAmount;
    }

//    @ValidateNumeric(minValue = 0, maxValue = 9999999999999.99)
    public void setVarAmount(BigDecimal varAmount) {
        this.varAmount = varAmount;
    }
    
    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumn(name = "USR_ID", referencedColumnName = "id", nullable = false, insertable = false, updatable = false)
    public UsersBean getUser() {
        return user;
    }
    
    public void setUser(UsersBean user) {
        this.user = user;
    }
    
//    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
//    @JoinColumn(name = "USR_ID", referencedColumnName = "id", nullable = false, insertable = false, updatable = false)
//    public SecurityUser getSecurityUser() {
//        return securityUser;
//    }
//    
//    public void setSecurityUser(SecurityUser securityUser) {
//        this.securityUser = securityUser;
//    }

  

}
